package com.soil.code.generation.domain.code.entity;

import lombok.Data;

import java.util.Collections;
import java.util.LinkedList;
import java.util.List;

/**
 * @author zeno
 */
@Data
public class PersistentObject{

  /** 包名 */
  private String pkg;

  /** 作者 */
  private String author;

  /** 对象类名 */
  private String className;

  /** 表名 */
  private String tableName;

  /** 表注释 */
  private String tableComment;

  /** 执久对象字段模型 */
  private List<PersistentObjectField> fields;

  private List<String> names;

  public PersistentObject(){
    this.fields = Collections.emptyList();
    names = new LinkedList<>();
    names.add("abc");
    names.add("abc123");
  }

  public void addField(PersistentObjectField field){
    if( this.fields.isEmpty() ){
      this.fields = new LinkedList<>();
    }

    this.fields.add(field);
  }
}
